#!/usr/bin/env python
# coding=utf-8


import wsgiref.handlers


from google.appengine.ext import webapp
from django.utils import simplejson

def print_r(obj):
    return simplejson.dumps( obj,indent=4,ensure_ascii=False) 

class MainHandler(webapp.RequestHandler):

  def get(self):
    obj = {
      "name"  : "sample name",
      "desc"  : "sample desc",
      "option"  : {
        "val1"  : "value1",
        "val2"  : "value2",
        "val3"  : 333,
      },
      "arrary"  : [
        1,2,3,4,5
      ],
    }

    self.response.out.write( '<pre>' + print_r(obj) + '</pre>' )


def main():
  application = webapp.WSGIApplication([('/print_r', MainHandler)],
                                       debug=True)
  wsgiref.handlers.CGIHandler().run(application)


if __name__ == '__main__':
  main()
